import { Controller, Get } from '@midwayjs/core';

// 控制器
@Controller('/menu')
export class AuthController {
  @Get('/all')
  async info() {
    return {
      code: 0,
      data: [
        {
          meta: {
            title: 'Root',
            hideInMenu: true,
          },
          name: 'Root',
          path: '/',
          component: '/_core/index',
        },
        {
          path: '/link',
          meta: {
            title: '外链菜单',
            icon: 'carbon:unlink',
          },
          name: 'Link',
          component: 'BasicLayout',
          children: [
            {
              path: '/link/vben',
              name: 'vben',
              meta: {
                title: '文档地址',
                icon: 'https://unpkg.com/@vbenjs/static-source@0.1.7/source/logo-v1.webp',
                iframeSrc: 'https://doc.vben.pro',
              },
            },
            {
              path: '/link/vite',
              name: 'link-vite',
              meta: {
                title: 'vite官方文档',
                icon: 'https://cn.vitejs.dev/logo.svg',
                iframeSrc: 'https://cn.vitejs.dev/',
              },
            },
          ],
        },
        {
          path: '/vite',
          name: 'vite',
          component: 'BasicLayout',
          meta: {
            title: 'vite官方文档',
            iframeSrc: 'https://cn.vitejs.dev/',
            icon: 'https://cn.vitejs.dev/logo.svg',
            // link: 'https://cn.vitejs.dev/',
          },
        },
        {
          component: 'BasicLayout',
          meta: {
            order: -1,
            title: 'page.dashboard.title',
            icon: 'carbon:dashboard',
          },
          name: 'Dashboard',
          path: '/dashboard',
          children: [
            {
              name: 'Analytics',
              path: '/dashboard/analytics',
              component: '/dashboard/analytics/index',
              meta: {
                affixTab: true,
                title: 'page.dashboard.analytics',
              },
            },
            {
              name: 'Workspace',
              path: '/dashboard/workspace',
              component: '/dashboard/workspace/index',
              meta: {
                title: 'page.dashboard.workspace',
              },
            },
          ],
        },
        {
          component: 'BasicLayout',
          meta: {
            icon: 'carbon:color-palette',
            keepAlive: true,
            order: 1000,
            title: '个性化',
          },
          name: 'individuation',
          path: '/individuation',
          redirect: '/individuation/theme',
          children: [
            {
              name: 'theme',
              path: '/individuation/theme',
              meta: {
                icon: 'carbon:brightness-contrast',
                title: '主题设置',
              },
              component: '/individuation/theme',
            },
            {
              name: 'taskbar',
              path: '/individuation/taskbar',
              meta: {
                icon: 'carbon:collapse-all',
                title: '任务栏设置',
              },
              component: '/individuation/taskbar',
            },
            {
              name: 'desktop',
              path: '/individuation/desktop',
              meta: {
                icon: 'carbon:collapse-all',
                title: '桌面设置',
              },
              component: '/individuation/desktop',
            },
            {
              name: 'window',
              path: '/individuation/window',
              meta: {
                icon: 'carbon:collapse-all',
                title: '窗口设置',
              },
              component: '/individuation/window',
            },
          ],
        },
        {
          component: 'BasicLayout',
          meta: {
            icon: 'carbon:operations-field',
            keepAlive: true,
            order: 1000,
            title: '系统管理',
          },
          name: 'Demos',
          path: '/system',
          redirect: '/system/user',
          children: [
            {
              name: 'user',
              path: '/system/user',
              meta: {
                icon: 'mdi:cloud-key-outline',
                title: '用户管理',
              },
              component: '/system/user/index',
            },
          ],
        },
      ],
      error: null,
      message: 'ok',
    };
  }
}
